import http from './interface'

export const GetGoodsList = (data) =>{
	return http.request({
	    url: '/api/BaseGoods',
		method:'GET',
	    data,
	})
}

export const SaveProduct = (data) => {
	try {
		const response = http.request({
			url: '/api/BaseGoods',
			method: 'POST',
			data,
		});

		// 返回请求结果
		return response;
	} catch (error) {
		throw error; // 抛出错误以便调用方处理
	}
};

export const UpdateProduct = (data) => {
	try {
		const response = http.request({
			url: '/api/BaseGoods',
			method: 'PUT',
			data,
		});

		// 返回请求结果
		return response;
	} catch (error) {
		throw error; // 抛出错误以便调用方处理
	}
};


export default {
	GetGoodsList,
	SaveProduct,
	UpdateProduct
}